import java.util.Scanner;

public class Text2 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
            System.out.println(Math.abs(s2.length()-s1.length()));

    }
}
